package self;
// alt+enter  ctrl+/
public class Test01 {
    public static void main(String[] args) {
        Object de= new C();
        A de1 = (A)de;
        B de2 = (B)de;
        C de3 = (C)de;
        System.out.println(de.getClass().getName());
        System.out.println(de1.getClass().getName());
        System.out.println(de2.getClass().getName());
        System.out.println(de3.getClass().getName());
        de1.show();
        de2.show();
        de3.show();
        System.out.println(de1.i);
        System.out.println(de2.i);
        System.out.println(de3.i);
    }

}
class A {
    int i = 10;
    public void show(){
        System.out.println("A");
    }
}
class B extends A {
    int i = 20;
    public void show(){
        System.out.println("B");
    }
}
class C extends B {
    int i = 30;
    public void show(){
        System.out.println("C");
    }
}